package com.sugar.follow.up.module.business.dal.mysql.questionnairetemplatequestion;

import java.util.*;

import com.sugar.follow.up.framework.common.pojo.PageResult;
import com.sugar.follow.up.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.sugar.follow.up.framework.mybatis.core.mapper.BaseMapperX;
import com.sugar.follow.up.module.business.dal.dataobject.questionnairetemplatequestion.QuestionnaireTemplateQuestionDO;
import org.apache.ibatis.annotations.Mapper;
import com.sugar.follow.up.module.business.controller.admin.questionnairetemplatequestion.vo.*;

/**
 * 问卷模板题目 Mapper
 *
 * @author Ysugar
 */
@Mapper
public interface QuestionnaireTemplateQuestionMapper extends BaseMapperX<QuestionnaireTemplateQuestionDO> {

    default PageResult<QuestionnaireTemplateQuestionDO> selectPage(QuestionnaireTemplateQuestionPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<QuestionnaireTemplateQuestionDO>()
                .eqIfPresent(QuestionnaireTemplateQuestionDO::getTemplateId, reqVO.getTemplateId())
                .eqIfPresent(QuestionnaireTemplateQuestionDO::getTitle, reqVO.getTitle())
                .eqIfPresent(QuestionnaireTemplateQuestionDO::getType, reqVO.getType())
                .betweenIfPresent(QuestionnaireTemplateQuestionDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(QuestionnaireTemplateQuestionDO::getId));
    }

}